function thisrender(this, varargin)
%RENDER Renders the UI components of the object
%   RENDER(H, HFIG, POS)
%   H       -   Object handle
%   HFIG    -   Figure handle, if none specified, gcf is used
%   POS     -   Containing frame position

%   Author(s): Z. Mecklai
%   Copyright 1988-2003 The MathWorks, Inc.
%   $Revision: 1.5.4.5 $  $Date: 2008/05/31 23:28:22 $

frPos = parserenderinputs(this, varargin{:});

% Get/Set defaults
sz   = gui_sizes(this);
hFig = get(this, 'FigureHandle');
cbs  = siggui_cbs(this);

if isempty(frPos), error(generatemsgid('NotSupported'),'Position must be specified'); end

if strncmp(get(0, 'language'), 'ja', 2)
    w = 40*sz.pixf;
else
    w = 33*sz.pixf;
end

pos = [frPos(1)+sz.hfus frPos(2)+frPos(4)-sz.uh-2*sz.vfus-sz.lblTweak ...
        w sz.uh];

h.units_lbl = uicontrol('Parent', hFig, ...
    'Style',                      'Text', ...
    'visible',                    'off', ...
    'String',                     'Units:', ...
    'Tag',                        'fsspecifier_popup_lbl', ...
    'Horizontalalignment',        'left', ...
    'Units',                      'pixels', ...
    'Position',                   pos);

pos = [pos(1)+pos(3) pos(2)+sz.lblTweak ...
    frPos(1)+frPos(3)-pos(1)-pos(3)-17*sz.pixf sz.uh];

h.units = uicontrol('Parent', hFig, ...
    'Style',                  'popup', ...
    'visible',                'off', ...
    'String',                 set(this, 'Units'), ...
    'callback',               {cbs.property, this, 'units', 'change Fs units'}, ...
    'Tag',                    'fsspecifier_popup', ...
    'Value',                  2, ...
    'BackgroundColor',        'w', ...
    'Units',                  'pixels', ...
    'Position',               pos);

pos = get(h.units_lbl, 'Position');
if strncmp(get(0, 'language'), 'ja', 2)
    w = 32*sz.pixf;
else
    w = 24*sz.pixf;
end

pos = [pos(1)+sz.uuhs pos(2)-(sz.uh+sz.uuvs+sz.lblTweak) w sz.uh];

h.value_lbl = uicontrol('Parent', hFig, ...
    'Style',                      'Text', ...
    'visible',                    'off', ...
    'String',                     'Fs:', ...
    'Tag',                        'fsspecifier_editbox_lbl', ...
    'Horizontalalignment',        'left', ...
    'Units',                      'pixels', ...
    'Position',                   pos);

left = frPos(1)+sz.hfus+w+2*sz.uuhs;

pos = [left pos(2)+sz.lblTweak frPos(1)+frPos(3)-left-17 sz.uh];

h.value = uicontrol('Parent', hFig, ...
    'Style',                  'Edit', ...
    'callback',               {cbs.property, this, 'value', 'change Fs'}, ...
    'visible',                'off', ...
    'tag',                    'fsspecifier_editbox', ...
    'Units',                  'pixels', ...
    'position',               pos, ...
    'String',                 this.Value, ...
    'Horizontalalignment',    'left');

set(this, 'handles', h);

wrl = handle.listener(this, [this.findprop('Units') this.findprop('Value')], ...
    'PropertyPostSet', @lclprop_listener);

set(wrl, 'callbacktarget', this);
set(this, 'whenrenderedlisteners', wrl);

setupenablelink(this, 'units', {'hz','khz','mhz','ghz'}, 'value');

% -------------------------------------------------------------------------
function lclprop_listener(this, eventData)

prop_listener(this, eventData);

% [EOF]
